[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 VARSEG VAR1,VAR2

 Function
  Sets a variable to the segment address of another variable.

 Syntax
  VARSEG src,dest

   src   - The variable to get the segment address of.
   dest  - The variable to store the segment address in.

 Remarks
  This statement is primarily useful in conjunction with DOINTR.  It may
  be necessary to give an interrupt the address of a memory location that
  can be used to store information.  This statement will allow you to get
  the segment address of a specified variable to pass to DOINTR.

 Examples
  ' Create subdirectory - DOS function 39h
  INTEGER saddr, oaddr
  STRING  path
  LET path = "C:\$TMPDIR$"
  VARSEG path,saddr
  VAROFF path,oaddr
  DOINTR 21h,39h,0,0,oaddr,0,0,0,saddr,0
  IF (REGCF() & (REGAX() = 3)) THEN
   PRINTLN "Error:  Path not found"
  ELSE IF (REGCF() & (REGAX() = 5)) THEN
   PRINTLN "Error:  Access Denied"
  ELSE IF (REGCF()) THEN
   PRINTLN "Error:  Unknown Error"
  ELSE
   PRINTLN "Directory successfully created..."
  ENDIF

See Also: MKADDR() VARADDR VAROFF
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson